<%--
  Date: 2024/10/11 14:38
  Description: 学生信息主页面
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <!-- 引入 layui.css -->
    <link href="//unpkg.com/layui@2.9.17/dist/css/layui.css" rel="stylesheet">
    <style>
        .btn_head{
            margin-bottom: 15px;
        }
        .box{
            padding: 20px;
        }
    </style>
</head>
<body>


<div class="box">
    <div class="btn_head">
        <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm"
                onclick="javascript:window.location.href='addScore.jsp';">新增</button>
    </div>
    <table class="layui-table" lay-even lay-size="sm">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
            <col width="150">
        </colgroup>
        <thead>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>课程</th>
            <th>成绩</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${scoreList}" var="sc">
            <tr>
                <td>${sc.id}</td>
                <td>${sc.name}</td>
                <td>${sc.course}</td>
                <td>${sc.score}</td>
                <td>
                    <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm"
                            onclick="javascript:window.location.href='/javaweb/score?method=selectOne&id='+${sc.id};">编辑</button>
                    <button class="layui-btn layui-btn-primary layui-border-red layui-btn-sm"
                            onclick="javascript:window.location.href='/javaweb/score?method=deleteScore&id='+${sc.id};">删除</button>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
    <span>${info}</span>
    <c:remove var="info" scope="session"></c:remove>
</div>

</body>
</html>
